home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
User's Choice Windows CD
/
User's Choice Windows CD (CMS Software)(1993).iso
/
windows4
/
prndrv.zip
/
COPY.C
< prev
next >
Wrap
Text File
|
1992-02-20
|
2KB
|
87 lines
//*************************************************************
// File name: COPY.C
//
// Description:
// This file contains the function to get file date and
// time.
//
// Functions:
// GetFileDateTime (int, unsigned int*, unsigned int *);
//
// Comments:
//
// Build Environment:
//
// Windows SDK v3.0, C6.0
//
// History: Date Author Comment
// 12/19/91 Eric Flo Created
//
// Written by Microsoft Product Support Services, Windows Developer Support
// Copyright (c) 1992 Microsoft Corporation. All rights reserved.
//*************************************************************
/* Function proto-type for Interrupt 21 */
void far pascal DOS3CALL (void);
//*************************************************************
//
// GetFileDateTime()
//
// Purpose:
// Gets the date and time of the file when it
// was last written to.
//
//
// Parameters:
// int hFile - File handle.
// unsigned * uTime - Pointer to variable to contain the time.
// unsigned * uDate - Pointer to variable to contain the date.
//
//
// Return: (unsigned int)
//
// 0 if successful
// Error number if unsuccessful
//
//
// Comments:
// This function calls int 21 function 5700h to get
// the file date and time.
//
//
// History: Date Author Comment
// 12/23/91 Eric Flo Created
//
//*************************************************************
unsigned int GetFileDateTime (int hFile, unsigned int* uTime,
unsigned int* uDate)
{
unsigned int uResult;
_asm
{
mov bx,hFile ; bx contains the file handle
mov ax,5700h ; GetFileDateTime
call DOS3CALL
jc error
mov bx,uTime
mov WORD PTR [bx],cx ; store time in uTime
mov bx,uDate
mov WORD PTR [bx],dx ; store date in uDate
mov uResult,0000h
jmp done
error: ; Error
mov uResult,ax
done:
}
return (uResult);
}
/* End of File */